package com.rabbit2020.web;

import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;

/**
 * 作者: LCG
 * 日期: 2020/2/27 22:59
 * 描述: 设置消息的参数
 */

public class MyMessagePost implements MessagePostProcessor {
    @Override
    public Message postProcessMessage(Message message) throws AmqpException {

        //设置消息过期时间
        message.getMessageProperties().setExpiration("10000");

        return message;
    }
}
